<div class="container-fluid form-horizontal">
    <style type="text/css">
        .col-lg-1, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-md-1, .col-md-10, .col-md-11, .col-md-12, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-sm-1, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-xs-1, .col-xs-10, .col-xs-11, .col-xs-12, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9 {
            position: inherit !important;; 
        }
    </style>

    <div class="col-xs-12">
        <div class="form-group mt10">
            <label class="col-xs-2 control-label">选择门店</label>
            <div class="col-xs-3">
                <ui-select ng-model="codeStr.str" theme="bootstrap" ng-change="changeview()">
                    <ui-select-match placeholder="请选择一个门店">{{$select.selected.name}}</ui-select-match>
                    <ui-select-choices repeat="item.code as item in page.viewlist | filter: $select.search">
                        <span ng-bind-html="item.name | highlight: $select.search"></span>
						【<span ng-bind-html="item.code | highlight: $select.search"></span>	】
                    </ui-select-choices>
                </ui-select>
            </div>
            <div class="col-xs-1">
                <a ng-click="add()" class="btn btn-success btn-sm">添加门店</a>
            </div>
        </div>
    </div>
    <div class="col-xs-12">
        <div class="form-group" ng-if="tempArr.length">
            <label class="col-sm-2 col-xs-12 control-label">已选门店</label>
            <div class="col-sm-9 col-xs-12">
                <div class="input-group">
                    <div class="" ng-repeat="item in tempArr" style="display: inline; margin-right:5px;">
                        <a class="btn btn-info btn-sm mt10" ng-dblclick="del($index)">
                            {{item.view_name}} &nbsp;&nbsp;
                            <span class="glyphicon glyphicon-remove" ng-click="del($index)"></span>
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 col-xs-12 control-label">有效期开始</label>
            <div class="col-sm-4 col-xs-12">
                <div class="input-group">
                    <div class="pull-left input-group">
                        <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="periodstart.lable" is-open="periodstart.opened"
                            readonly close-text="关闭" current-text="今天" clear-text="清除" />
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-default"
                                    ng-click="dateOpen($event, periodstart)">
                                <i class="glyphicon glyphicon-calendar"></i>
                            </button>
                        </span>
                    </div>
                </div>
            </div>
            <div class="col-sm-6 mt10">
                <font face="Courier" class="text-danger"></font>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 col-xs-12 control-label">有效期结束</label>
            <div class="col-sm-4 col-xs-12">
                <div class="input-group">
                    <div class="pull-left input-group">
                        <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="periodend.lable" is-open="periodend.opened"
                            readonly close-text="关闭" current-text="今天" clear-text="清除" />
                        <span class="input-group-btn">
                            <button type="button" class="btn btn-default"
                                    ng-click="dateOpen($event, periodend)">
                                <i class="glyphicon glyphicon-calendar"></i>
                            </button>
                        </span>
                    </div>
                </div>
            </div>
            <div class="col-sm-6 mt10">
                <font face="Courier" class="text-danger"></font>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 col-xs-12 control-label">是否需要预约</label>
            <div class="col-sm-4 col-xs-12">
                <select class="form-control" ng-model="tickettypeobj.appoint">
                    <option value="0">无需预约</option>
                    <option value="1">需要预约</option>		           
                </select>
            </div>
            <div class="col-sm-6 mt10 text-right">
                <a ng-click="save()" class="btn btn-success btn-sm">添加记录</a>
            </div>
        </div>
    </div>
    <table class="table table-bordered mt10">
        <thead>
            <tr>
                <th class="col-md-3 text-center">门店</th>
                <th class="col-md-3 text-center">名称</th>
                <th class="col-md-2 text-center">有效期开始</th>
                <th class="col-md-2 text-center">有效期结束</th>
                <th class="col-md-2 text-center">是否需要预约</th>
                <th class="col-md-2 text-center">操作</th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="obj in shopArr">
                <td class="text-center">
                    <a class="btn btn-info btn-sm mt10" ng-repeat="place in obj.placeArr" ng-if="place.name">
                        {{place.name}} &nbsp;&nbsp;
                        <span class="glyphicon glyphicon-remove" ng-click="delPlace($index, $parent.$index)" ng-show="obj.placeArr.length > 1"></span>
                    </a>
                </td>
                <td class="text-center">
                    <input type="text" class="form-control" ng-model="obj.name" />
                </td>
                <td class="text-center">
                    <div class="input-group">
                        <div class="pull-left input-group">
                            <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="obj.start_date.lable" is-open="obj.start_date.opened"
                                readonly close-text="关闭" current-text="今天" clear-text="清除" />
                            <span class="input-group-btn">
                                <button type="button" class="btn btn-default"
                                        ng-click="dateOpen($event, obj.start_date)">
                                    <i class="glyphicon glyphicon-calendar"></i>
                                </button>
                            </span>
                        </div>
                    </div>
                </td>
                <td class="text-center">
                    <div class="input-group">
                        <div class="pull-left input-group">
                            <input type="text" class="form-control" datepicker-popup="yyyy-MM-dd" ng-model="obj.end_date.lable" is-open="obj.end_date.opened"
                                readonly close-text="关闭" current-text="今天" clear-text="清除" />
                            <span class="input-group-btn">
                                <button type="button" class="btn btn-default"
                                        ng-click="dateOpen($event, obj.end_date)">
                                    <i class="glyphicon glyphicon-calendar"></i>
                                </button>
                            </span>
                        </div>
                    </div>
                </td>
                <td class="text-center">
                    <select class="form-control" ng-model="obj.appoint" ng-disabled="saleobj.state != '0'">
                        <option value="0">无需预约</option>
                        <option value="1">需要预约</option>		           
                    </select>
                </td>
                <td class="text-center">
                    <a class="btn btn-info btn-xs" ng-click="save($index)" ng-if="shopArr.length">
                        保&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;存</a>
                    <a ng-click="save2(obj)" 
                        class="btn btn-success btn-xs" 
                        ng-if="(saleobj.state == '0' || saleobj.state == '2') && obj.is_available == '1'">
                        恢&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;复</a>
                    <a ng-click="del1(obj)" 
                        class="btn btn-danger btn-xs" 
                        ng-if="(saleobj.state == '0' || saleobj.state == '2') && obj.is_available == '0'">
                        删&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;除</a>
                </td>
            </tr>
        </tbody>
    </table>
    <div class="modal-footer text-center">
    </div>
</div>